#!/bin/bash
# 根据规则生成 triple 数据集
# timestamp=$(date +%s)

timestamp=$(date +"%m%d%H%M%S")
# dataset_name=('conll04' 'SciERC' 'semval-RE')
# dataset_name=('conll04' 'SciERC' 'semval-RE')
dataset_name=('semval-RE')
# dataset_name=('SciERC')
# dataset_name=('conll04')

TIMES=1

rules=(
    ''
    # 'add_triple'
    # 'add_same_type_triple'
    # 'remove_triple'
    # 'replace_same_type_entity'
    # 'swap_triple'
    # "add_triple remove_triple replace_same_type_entity swap_triple"
    "add_triple"
)

for ((i = 1; i <= TIMES; i++)); do
    echo "Executing script for the $i time"
    for dataset in "${dataset_name[@]}"; do
        for rule in "${rules[@]}"; do
            if [ -n "$rule" ]; then
                echo "Executing gen4da.sh for dataset: $dataset, rule: $rule"
                bash ./gen4da.sh "$dataset" "$timestamp" "$rule"
            else
                echo "Skipping gen4da.sh for empty rule"
            fi
            bash train4hf.sh $dataset $timestamp $rule
        done
    done
done
